﻿using System;
using System.Collections.Generic;
using XSTDZ.ERP.Application.DataContracts;

namespace XSTDZ.ERP.Application
{
    public interface IPermisstionService
    {
        Guid AddPermission(PermissionDto permissionDto);
        void UpdatePermission(PermissionDto permissionDto);
        void DeletePermission(Guid permissionId);
        PermissionDto GetPermission(Guid permissionId);
        IEnumerable<PermissionDto> GetAllPermission();
        IEnumerable<PermissionDto> GetAllPermission(Guid parentPermissionId);

        void AddUiPermission(PermissionDto permissionDto,UiPermissionDto uiPermissionDto);
        void UpdateUiPermission(PermissionDto permissionDto);

        Guid AddUiPermission(Guid permissionId,UiPermissionDto uiPermissionDto);
        void UpdateUiPermission(UiPermissionDto uiPermissionDto);
        void DeleteUiPermission(Guid uiPermissionId);
        UiPermissionDto GetUiPermission(Guid uiPermissionId);
        IEnumerable<UiPermissionDto> GetUiPermissions();
        IEnumerable<UiPermissionDto> GetUiPermissions(Guid permissionId);
        IEnumerable<UiPermissionDto> GetUiPermissions(string controllerName, string actionName);
      

        Guid  Add(OperationDto operationDto);
        void  Update(OperationDto operationDto);
        void Update(Guid operationId,Guid permissionId);
        void DeleteOperation(Guid operationId);
        IEnumerable<OperationDto> GetAllOperations();
        OperationDto GetOperation(Guid id);
        OperationDto GetOperation(string code);


        Guid AddRole(RoleDto roleDto);
        void UpdateRole(RoleDto roleDto);
        void DeleteRole(Guid roleId);
        RoleDto GetRole(Guid roleId);
        IEnumerable<RoleDto> GetAllRole();

        void AddOrUpdatePermissionsOfRole(Guid RoleId, IEnumerable<Guid> uiPermissionIds, IEnumerable<Guid> permissionIds,string typeName);
        IList<Guid> GetSelectPermissionsOfRole(Guid RoleId);

       
    }
}
